<style type="text/css">

</style>
<div class="col-sm-12 mt20">
  <div class="panel">
    <div class="panel-body">
      <div class="col-sm-10 control-label" style="font-size: 15px; margin-top: 8px">
        <label class="col-sm-3 control-label">拼团活动产品：
          <strong class="ng-binding">{{totalItems || 0}}</strong> 个
        </label>
      </div>
      <div class="col-sm-2">
        <button class="btn btn-success btn-block" ng-click="addNew()">添  加</button>
      </div>
    </div>
  </div>
  <div class="panel panel-default">
    <div class="panel-body">
      <div class="col-lg-12">
        <div class="col-lg-3">
          <input type="text" class="form-control" placeholder="产品名称" ng-model="searchform.sale_name">
        </div>
        <div class="col-lg-2-4">
          <input type="text" class="form-control" placeholder="产品编号" ng-model="searchform.sale_code">
        </div>
        <div class="col-lg-2-4">
          <ui-select ng-model="searchform.show" theme="bootstrap">
            <ui-select-match placeholder="请产品状态.">{{$select.selected.name}}</ui-select-match>
            <ui-select-choices repeat="item.value as item in searchform.showList">
              <span ng-bind-html="item.name"></span>
            </ui-select-choices>
          </ui-select>
        </div>
        <div class="col-lg-2 pull-right">
          <button class="btn btn-info btn-block" ng-click="search(1)">立即搜索</button>
        </div>
      </div>
    </div>
    <!-- 拼团产品列表 -->
    <div class="panel-body">
      <table class="table table-bordered">
        <thead>
          <th style="min-width: 270px;">基本信息</th>
          <th class="text-center" style="width: 150px;">原价格</th>
          <th class="text-center" style="width: 120px;">活动开始</th>
          <th class="text-center" style="width: 120px;">活动结束</th>
          <th class="text-center" style="width: 150px;">已购买人数</th>
          <th class="text-center" style="width: 230px;">操作</th>
        </thead>
        <tbody>
          <tr ng-repeat="item in sale_list">
            <td>产品名称：{{item.sale_name}}<br/> 产品编号：{{item.sale_code}}</td>
            <td class="text-center" style="vertical-align: middle;">
              <strong style="color: red;">{{item.market_price | currency : '￥'}}</strong>
            </td>
            <td class="text-center">{{item.start_time}}</td>
            <td class="text-center">{{item.end_time}}</td>
            <td class="text-center" style="vertical-align: middle;">{{item.buy_num}}</td>
            <td class="text-center" style="vertical-align: middle;">
              <button type="button" class="btn btn-info btn-xs" ng-click="editSale(item)">编辑</button>
              <button type="button" class="btn btn-success btn-xs" ng-if="item.show=='0'" ng-click="setShow(item,'1')">显示</button>
              <button type="button" class="btn btn-danger btn-xs" ng-if="item.show!='0'" ng-click="setShow(item,'0')">隐藏</button>
              <button type="button" class="btn btn-danger btn-xs" ng-click="delete(item)">删除</button>
            </td>
          </tr>
        </tbody>
      </table>
      <div class="text-right">
        <pagination total-items="totalItems" ng-model="currentPage" ng-change="search(currentPage)" 
        previous-text="上一页" next-text="下一页" first-text="首页" last-text="尾页" max-size="5" 
        boundary-links="true" rotate="false" items-per-page="itemsPerPage"></pagination>
      </div>
    </div>
  </div>
</div>